<#macro bind path>
    <#if htmlEscape?exists>
        <#assign status = springMacroRequestContext.getBindStatus(path, htmlEscape)>
    <#else>
        <#assign status = springMacroRequestContext.getBindStatus(path)>
    </#if>
<#-- assign a temporary value, forcing a string representation for any
kind of variable. This temp value is only used in this macro lib -->
    <#if status.value?exists && status.value?is_boolean>
        <#assign stringStatusValue=status.value?string>
    <#else>
        <#assign stringStatusValue=status.value?default("")>
    </#if>
</#macro>


<#macro formRadioButtons path options code attributes="">
    <@bind path/>
<label class="col-md-2 control-label">${springMacroRequestContext.getMessage(code)}</label>
    <#list options as value>
    <label class="radio-inline">
        <#assign  scode="${code}.${value}"/>
        <#assign id="${status.expression?replace('[','')?replace(']','')}${value_index}">
        <input type="radio" id="${id}" name="${status.expression}" value="${value?html}"<#if stringStatusValue == value>
               checked="checked"</#if> ${attributes}/>
    ${springMacroRequestContext.getMessage(scode)}</label>

    </#list>
</#macro>

<#macro duoshuo bool id title url>
    <#if bool>
    <!-- 多说评论框 start -->
    <div class="ds-thread"  data-thread-key="${id}" data-title="${title}" data-url="${url}"/>
    <!-- 多说评论框 end -->
    <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
    <script type="text/javascript">
        var duoshuoQuery = {short_name: "kaibb"};
        (function () {
            var ds = document.createElement('script');
            ds.type = 'text/javascript';
            ds.async = true;
            ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
            ds.charset = 'UTF-8';
            (document.getElementsByTagName('head')[0]
            || document.getElementsByTagName('body')[0]).appendChild(ds);
        })();
    </script>
    <!-- 多说公共JS代码 end -->
    </#if>
</#macro>


<#macro footer>
<footer class="text-center ">
    <div class="container">
        <div class="col-md-12 row  content">
        <address >
            <strong>QQ:253017881</strong><br/>
            <abbr title="Phone">P:</abbr> 17070858080<br/>
            <script type="text/javascript" src="http://tajs.qq.com/stats?sId=23984908" charset="UTF-8"></script>
            <a href="mailto:#">www@kaibb.com</a>
        </address>
        </div>
    </div>
</footer>
</#macro>